package code.main.controller.login
{
	import code.app.AppView;
	import code.main.view.login.ConnectTableView;
	
	import com.yy.mvc.ctrl.Controller;
	
	import flash.display.DisplayObjectContainer;

	/**
	 *连接桌子loading控制器 
	 * @author YY
	 * 
	 */
	public class ConnectCtrl extends Controller
	{
		private var _connectView:ConnectTableView;
		private var _isOpen:Boolean = false;//是否打开
		public function ConnectCtrl()
		{
		}
		
		override public function start():void {
			
		}
		
		/**
		 *打开连接界面 
		 * 
		 */
		public function open():void {
			_isOpen = true;
			_connectView = new ConnectTableView();
			AppView.getInstance().connectLayer.addChild(_connectView);
			AppView.getInstance().connectLayer.visible = true;
		}
		
		/**
		 * 关闭连接界面
		 * 
		 */
		public function close():void{
			_isOpen = false;
			var layer:DisplayObjectContainer = AppView.getInstance().connectLayer;
			if(_connectView && layer.contains(_connectView)) {
				layer.removeChild(_connectView);
			}
			layer.visible = false;
		}

		public function get isOpen():Boolean
		{
			return _isOpen;
		}

	}
}